<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title></title>
  <style type="text/css">
    *{
      padding:0;
      margin:0
    }

    .nav {
      list-style: none;
      background-color: #bfa;
      width: 1000px;
      margin: 50px auto;
      overflow: hidden;
    }

    .nav li {
      float: left;
      width: 25%;
    }

    .nav a {
      display: block;
      width: 100%;
      text-align: center;
      padding: 5px 0;
      text-decoration: none;
      color: white;
      font-size: bold;
    }

    .nav a:hover {
      background-color: red;
    }
  </style>
</head>

<body>
  <ul class="nav">
    <li><a href=" ">首页</a></li>
    <li><a href="#">新闻</a></li>
    <li><a href="#">联系</a></li>
    <li><a href="#">关于</a></li>
  </ul>
</body>

</html>